﻿using System;
using System.Web.Mvc;
using Application.MainModule.DinnerManagement;
using Presentation.Web.UI.Attibutes;

namespace Presentation.Web.UI.Controllers
{
    [HandleErrorWithELMAH]
    public class HomeController : Controller
    {
        #region Members

        /// <summary>
        /// Instance of the customer service.
        /// </summary>
        private IDinnerManagementService _dinnerService;
        private const string XrdsType = "application/xrds+xml";
        #endregion

        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="CustomerController"/> class.
        /// </summary>
        /// <param name="dinnerService"> </param>
        public HomeController(IDinnerManagementService dinnerService)
        {
            _dinnerService = dinnerService;
        }

        #endregion

        #region Actions

        /// <summary>
        /// Display a paged listing of the existing customers.
        /// </summary>
        /// <param name="page">The page.</param>
        /// <param name="pageSize">The page size.</param>
        /// <returns></returns>
        public ActionResult Index()
        {
            if (Request != null && Request.AcceptTypes != null && Array.IndexOf(Request.AcceptTypes, XrdsType) >= 0)
            {
                return View("Xrds");
            }
            // Other Providers don't say they're performing RP discovery, so always include an HTTP header to help them.
            if (Response != null)
                Response.AppendHeader("X-XRDS-Location", Url.Action("Xrds"));

            return View();
        }
        public ActionResult About()
        {
            
            return View();
        }
        #endregion
    }
}

